import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.TreeSet;
import java.util.logging.Logger;
import java.util.stream.Collector;
import java.util.stream.Collectors;

public class Stream1 {

    public static void main(String[] args) {

        List<String> strings = Arrays.asList("aaa", "bbb", "ccc", "ddd");
        //long count =
                strings.stream()
                .map(s -> {
                    System.out.println(s);
                    return s.toUpperCase();
                });
                int[] s = {1,2,2,3,4};
                int i = 0;
                i = s[-2];

        //.count();
       // System.out.println(count);
        Optional emptyOptional = Optional.empty();
        System.out.println(emptyOptional.isPresent());
        System.out.println(emptyOptional.orElse("b"));
        System.out.println(emptyOptional.orElseGet(()->"C"));
    }

}
